<%@ taglib prefix="s" uri="/struts-tags" %>
<%@page  pageEncoding="UTF-8" %>

<s:form action="searchPerson" >
	<s:hidden name="id" value="%{id}" />
	<s:hidden name="subjectType" value="%{subjectType}" />
	
	<s:textfield label="Firstname" name="person.firstName" />
	<s:textfield label="Lastname" name="person.lastName" />
	<!--<s:textfield label="Birth date" name="person.birthDate" />-->
	<s:textfield label="Social security number" name="person.identityCode" />
    <s:textfield label="Contact" name="contact.valueText"/>
	<s:textfield label="Country" name="address.country"/>
	<s:textfield label="County" name="address.county"/>
	<s:textfield label="Town/village" name="address.townVillage"/>
	<s:textfield label="StreetAddress" name="address.streetAddress"/>
	<s:textfield label="Zipcode" name="address.zipcode"/>
	<s:iterator value="attributes" id="attribute" status="stat">
		<s:hidden value="%{#attribute.dataType}" name="attributes[%{#stat.count - 1}].dataType" />
		<s:hidden value="%{#attribute.subjectAttributeType.typeName}" name="attributes[%{#stat.count - 1}].subjectAttributeType.typeName" />
		<s:textfield label="%{#attribute.subjectAttributeType.typeName}" name="attributes[%{#stat.count - 1}].valueText" />
	</s:iterator>
	<s:submit value="Search"/>

<table>
<s:iterator value="resultListPerson" id="result" status="stat">
	<tr>
		<td>
			<s:property value="%{#result.firstName}" />
		</td>
		<td>
			<s:url id="url" action="editSubject" escapeAmp="false">
			    <s:param name="id" value="%{#result.id}"/>
			    <s:param name="subjectType" value="%{subjectType}"/>
			</s:url>
			<s:a href="%{url}">Edit</s:a>
		</td>
	</tr>
</s:iterator>
</table>
</s:form>